var arr = [4, 1, 1, 4, 2, 3, 4, 4, 1, 2, 4, 9, 3];

var mostFrequentCount = 0,
    mostFrequentValue;

for (var i = 0; i < arr.length - 1; i++)
{
    var elementFrequency = 1;

    for (var j = i + 1; j < arr.length; j++)
    {
        if (arr[j] === arr[i])
        {
            elementFrequency++;
            arr.splice(j, 1);
            j--;
        }
    }

    if (elementFrequency > mostFrequentCount)
    {
        mostFrequentCount = elementFrequency;
        mostFrequentValue = arr[i];
    }

    arr.splice(i, 1);
    i--;
}

console.log(mostFrequentValue + " -> " + mostFrequentCount + " times");